package com.java.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.java.po.Job;
import com.java.po.JobMap;
import com.java.service.JobService;
import com.java.tool.AjaxJson;

/**
 * Title:DepartController.java
 * Description:
 * @author:sprogrammer
 * @time:2018年2月23日下午8:09:19
 */
@Controller
@CrossOrigin()
@RequestMapping(method=RequestMethod.POST)
public class JobController {
	
	private AjaxJson ajaxJson;
	
	@Autowired
	private JobService jobService;
	
	public JobController(){
		ajaxJson = new AjaxJson();
		//jobService = new jobServiceImpl();
	}
	
	@RequestMapping(value = "/insertJob")
	public @ResponseBody AjaxJson insertJob(@RequestBody Job Job) throws Exception{
		ajaxJson = jobService.insertJob(Job);
		return ajaxJson;
	}
	
	@RequestMapping(value ="/deleteJob")
	public @ResponseBody AjaxJson deleteJob(@RequestBody Job Job) throws Exception{
		ajaxJson = jobService.deleteJobById(Job);
		return ajaxJson;
	}
	
	@RequestMapping(value ="/updateJob")
	public @ResponseBody AjaxJson updateJob(@RequestBody Job Job) throws Exception{
		ajaxJson = jobService.updateJobById(Job);
		return ajaxJson;
	}
	
	@RequestMapping(value ="/findALLJob")
	public @ResponseBody AjaxJson findJob(@RequestBody JobMap JobMap) throws Exception{
		ajaxJson = jobService.findAllJob(JobMap);
		return ajaxJson;
	}
	
	@RequestMapping(value ="/findJobByid")
	public @ResponseBody AjaxJson findJobByid(@RequestBody Job Job) throws Exception{
		ajaxJson = jobService.findJobByid(Job);
		return ajaxJson;
	}
	
	@RequestMapping(value ="/findJobSalary")
	public @ResponseBody AjaxJson findJobSalary(@RequestBody Job Job) throws Exception{
		ajaxJson = jobService.findJobSalary(Job);
		return ajaxJson;
	}
	
}
